/*package com.seari;

import java.util.Date;
import java.util.List;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.mongodb.core.MongoTemplate;

import com.seari.bean.AlarmHistory;
import com.seari.bean.AlarmReal;
import com.seari.mapper.MongoHistoryMapper;
import com.seari.mapper.MongoRealMapper;

@SpringBootApplication
@MapperScan("com.seari.mapper")
public class Application implements ApplicationRunner {

	@Autowired
	private MongoRealMapper mongoRealMapper;
	@Autowired
	private MongoTemplate mongoTemplate;
	@Autowired
	private MongoHistoryMapper mongoHistoryMapper;

	public static void main(String[] args) {

		SpringApplication.run(Application.class, args);

	}

	@Override
	public void run(ApplicationArguments arg0) throws Exception {

		// mongoRealMapper.deleteAll();

		mongoRealMapper.insert(new AlarmReal("2019", "南翔", "ems", "故障", 1, 0,
				0, "cc", "", ""));

		System.out.println("AlarmReal found with findAll():");
		System.out.println("-------------------------------");

		System.out.println("AlarmReal found with findByStatus():");
		System.out.println("****************************");

		List<AlarmReal> findByStatus = mongoRealMapper.findByStatus(1);
		for (AlarmReal alarmReal : findByStatus) {

			System.out.println(alarmReal);

		}

		System.out
				.println(">>>>>>>>>>>>>>>>>上面是根据恢复状态查询数据<<<<<<<<<<<<<<<<<<<<<<");

		for (AlarmReal alarmReal : mongoRealMapper.findAll()) {

			System.out.println(alarmReal);

		}

		System.out.println("AlarmReal found with findAll():");
		System.out.println("-------------------------------");

		for (AlarmReal alarmReal : mongoRealMapper.findAll()) {

			System.out.println(alarmReal);

		}

		System.out.println("**************************");
		System.out.println("AlarmReal found with queryByStatus():");

		// System.out.println(mongoRealMapper.queryByStatus(1));

		mongoHistoryMapper.insert(new AlarmHistory("2019", "龙阳路", "EMCS", "故障",
				1, 1, 0, "root", "", ""));

		System.out.println("AlarmHistory found with findAll():");
		System.out.println("-------------------------------");
		for (AlarmHistory alarmHistory : mongoHistoryMapper.findAll()) {

			System.out.println("历史数据表" + alarmHistory);

		}
		mongoHistoryMapper.deleteAll();
		mongoRealMapper.deleteBystatus(1);

	}
}*/
